package tech.aistar.day11;

/**
 * 本类用来演示:
 *
 * @author: success
 * @date: 2021/3/22 3:24 下午
 */
public class KVDemo<K,V> {
    private K key;

    private V value;

    public KVDemo() {
    }

    public KVDemo(K key, V value) {
        this.key = key;
        this.value = value;
    }

    public K getKey() {
        return key;
    }

    public void setKey(K key) {
        this.key = key;
    }

    public V getValue() {
        return value;
    }

    public void setValue(V value) {
        this.value = value;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("KVDemo{");
        sb.append("key=").append(key);
        sb.append(", value=").append(value);
        sb.append('}');
        return sb.toString();
    }
}
class TestKVDemo{
    public static void main(String[] args) {
        KVDemo<Integer,String> kvs = new KVDemo<>(1,"tom");

        System.out.println(kvs.getKey());
        System.out.println(kvs.getValue());
    }
}